home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 127 / PC Guia 127.iso / Software / Utils / GParted Live CD / Bin / gparted-livecd-0.2.2.iso / usr_sqfs / bin / unbuffer < prev    next >
Encoding:
Text File  |  2005-07-18  |  361 b   |  18 lines

  1. #!/bin/sh
  2. # \
  3. exec expect -- "$0" ${1+"$@"}
  4. # Description: unbuffer stdout of a program
  5. # Author: Don Libes, NIST
  6.  
  7. if {[string compare [lindex $argv 0] "-p"] == 0} {
  8.     # pipeline
  9.     set stty_init "-echo"
  10.     eval spawn -noecho [lrange $argv 1 end]
  11.     interact
  12. } else {
  13.     set stty_init "-opost"
  14.     eval spawn -noecho $argv
  15.     set timeout -1
  16.     expect
  17. }
  18.